import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:convert';

part 'my_info_response.freezed.dart';
part 'my_info_response.g.dart';

@freezed
class MyInfoResponse with _$MyInfoResponse {
  const factory MyInfoResponse({
    @JsonKey(name: "c") required int c,
    @JsonKey(name: "m") required String m,
    @JsonKey(name: "d") required D d,
  }) = _MyInfoResponse;

  factory MyInfoResponse.fromJson(Map<String, dynamic> json) =>
      _$MyInfoResponseFromJson(json);
}

@freezed
class D with _$D {
  const factory D({
    @JsonKey(name: "uid") required String uid,
    @JsonKey(name: "user_role") required String userRole,
    @JsonKey(name: "nick_name") required String nickName,
    @JsonKey(name: "gender") required String gender,
    @JsonKey(name: "birthday") required DateTime birthday,
    @JsonKey(name: "mobile") required String mobile,
    @JsonKey(name: "email") required dynamic email,
    @JsonKey(name: "face") required String face,
    @JsonKey(name: "face_200") required String face200,
    @JsonKey(name: "gold") required String gold,
    @JsonKey(name: "credit") required String credit,
    @JsonKey(name: "comment_count") required String commentCount,
    @JsonKey(name: "fav_count") required String favCount,
    @JsonKey(name: "third_party") required List<dynamic> thirdParty,
  }) = _D;

  factory D.fromJson(Map<String, dynamic> json) => _$DFromJson(json);
}
